package com.源码分析.window;

import java.util.List;

import org.junit.Test;

import reactor.core.publisher.Flux;

public class WindowUntilDemo {

	@Test
	public void windowUntilCutBeforeIntentionallyEmptyWindows() {
		Flux<List<String>> flux = Flux.just("ALPHA", "#", "BETA", "FFF", "#", "#")
		    .windowUntil("#"::equals, true) // 第二个参数定义我们是在满足谓词之前还是之后创建新切片
		    .flatMap(Flux::collectList);

		flux.subscribe(slist -> {
			for (String s : slist) {
				System.out.print(s + ", ");
			}
			System.out.println("---------------");
		});
	}

}
